﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Define
{
    public class BoxInfo
    {
        public long nDBID = 0;
        public int nBoxID = 0;
        public long nUnixTime = 0;
        public int nRoleID = 0;
    }

    public class BoxInfoEx : BoxInfo
    {
        public int nExID = 0;
    }

    /// <summary>
    /// 比较大小测试用例中的结构体
    /// </summary>
    public class RoleInfoForCompare
    {
        public int nRoleID = 0;
        public long UnixTime = 0;
        public bool bHaveBox = false;
    }

    public class NeedFixClass
    {
        public int A = 99;
        public int GetValue()
        {
            return A;
        }
    }

    public class HookClass
    {
        // 注意，不论下面的变量名为什么，都是NeedFixClass.A。
        public int C = 77;

        public int GetMyValue()
        {
            object o = this;
            if(o is NeedFixClass)
            {
                NeedFixClass ht = (o as NeedFixClass);

                ht.A = 100;
                C = 77;
                return ht.A;
            }

            return -1;
        }
    }

    /// <summary>
    /// 事件定义
    /// </summary>
    public enum EventTypes
    {
        /// <summary>
        /// 玩家初始化
        /// </summary>
        PlayerInit,

        /// <summary>
        /// 玩家在线 10秒 执行一次
        /// </summary>
        PlayerOnline,

        /// <summary>
        /// 游戏运行 0.5秒 执行一次
        /// </summary>
        GameRunning,
    }

    public class MethodConfig
    {
        /// <summary>
        /// 程序及名称
        /// </summary>
        public string assembleName;

        /// <summary>
        /// 补丁触发条件
        /// </summary>
        public EventTypes eventType;

        /// <summary>
        /// 要调用的类名
        /// </summary>
        public string fullClassName;

        /// <summary>
        /// 要调用的方法名
        /// </summary>
        public string methodName;

        /// <summary>
        /// 要额外传递的的参数
        /// </summary>
        public string[] methodParams;

        /// <summary>
        /// 要监控的协议ID
        /// </summary>
        public int cmdID;
    }

    public class Player
    {
        public int nRoleID = 0;
        public string strName = "";
    }

    public class GoodsData
    {
        public int nQuality;
        public int Categoriy;
        public int nSuitID;
        public int nGoodsID;
    }

    public class GoodsDataWitchIndex
    {
        public string strIndex;
        public GoodsData data;
    }
}
